from abc import ABCMeta,abstractmethod
class BaseWebSite(object):

    def __init__(self):
        self.KEY_JOB_TITLE = 'job_title'
        self.KEY_SALARY = 'salary'
        self.KEY_LOCATION = 'location'
        self.KEY_COMPANY_NAME = 'company_name'
        self.KEY_COMPANY_INFO = 'company_info'
        self.KEY_DETAIL_URL = 'detail_url'
        self.KEY_COMPANY_URL = 'company_url'

        self.KEY_DETAIL_JOB_DESC = 'detail_job_desc'
        self.parseCallback = None
        self.saveCallback = None

    def setParseCallback(self, callback):
        self.parseCallback = callback

    def setSaveCallback(self, callback):
        self.saveCallback = callback

    @abstractmethod  # 调用@abstractmethod规定子类必须有pay方法
    def loadData(self):
        pass

    @abstractmethod  # 调用@abstractmethod规定子类必须有pay方法
    def parseData(self):
        pass

    @abstractmethod  # 调用@abstractmethod规定子类必须有pay方法
    def loadPage(self,page):
        pass

    @abstractmethod  # 调用@abstractmethod规定子类必须有pay方法
    def loadAndParseDetailPage(self):
        pass

    @abstractmethod  # 调用@abstractmethod规定子类必须有pay方法
    def print(self):
        pass

    @abstractmethod  # 调用@abstractmethod规定子类必须有pay方法
    def saveExcel(self,filename):
        pass

    @abstractmethod  # 调用@abstractmethod规定子类必须有pay方法
    def saveDetailExcel(self, filename):
        pass



